<?php
/**
 * Created by PhpStorm.
 * User: dayu
 * Date: 2019/12/19
 * Time: 15:56
 */

namespace app\Validate;


class DiscountListValidate extends RequestValidate
{

    protected function rulesList()
    {
        switch ($this->action) {
            case 'discountList':
                return [
                    'start_time' => 'require|integer|regex:[0-9]{10}',
                    'end_time' => 'require|integer|regex:[0-9]{10}',
                    'pag' => 'sometimes|require|integer|>:0',
                    'number' => "sometimes|require|integer|>:0",

                ];
            case 'tuangouList':
                return [
                    'page' => 'require|integer|>:0',
                    'start_time' => 'require|integer|regex:[0-9]{10}',
                    'end_time' => 'require|integer|regex:[0-9]{10}',
                    'number' => "sometimes|require|integer|>:0",
                    'type' => "require|integer|>:0",
                ];
            case 'activityRregistration':
                return [
                    'goods_id' => 'require|integer|>=:0',
                    'tuangou_id' => 'require|integer|>=:0',
                ];
            //参加拼团人数查询
            case 'participantsNumber':
                return [
                    'tuangou_id' => 'require|integer|>=:0',
                ];
            //限时购订单创建
            case 'purchase':
                return [
                    "goods_sku_list"=>'require',
                    "addres_id"=>'require|integer|>:0',
                    "buyer_message"=>'require',
                    "coupon_id"=>'require|integer',
                ];
        }
    }

}